package com.chenye.consul;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.cloud.netflix.zuul.EnableZuulServer;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther:chenye
 * @Data:2018/7/11
 * @Description:
 */
@SpringBootApplication
@EnableDiscoveryClient
@RestController
@EnableZuulProxy
public class ConsulApplication {
    public static void main(String[] args){
        SpringApplication.run(ConsulApplication.class,args);
    }
    @Value("${server.port}")
    private String port;
    @RequestMapping("/hi")
    public String sayHi(){
        return "hi:"+port;
    }

    @RequestMapping("/healthCheck")
    public String healthCheck(){
        return "ok";
    }
}
